package com.atguigu.jxc.service.impl;

import com.atguigu.jxc.dao.GoodsDao;
import com.atguigu.jxc.dao.PurchaseListGoodsDao;
import com.atguigu.jxc.dao.ReturnListDao;
import com.atguigu.jxc.dao.ReturnListGoodsDao;
import com.atguigu.jxc.entity.Goods;
import com.atguigu.jxc.entity.ReturnList;
import com.atguigu.jxc.entity.ReturnListGoods;
import com.atguigu.jxc.service.ReturnListService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
public class ReturnListServiceImpl implements ReturnListService {


    @Resource
    private ReturnListDao returnListDao;

    @Resource
    private ReturnListGoodsDao returnListGoodsDao;

    @Resource
    private PurchaseListGoodsDao purchaseListGoodsDao;

    @Override
    @Transactional
    public void getReturnList(ReturnList returnList, ReturnListGoods list) {


        ReturnList returnList1 = new ReturnList();
        BeanUtils.copyProperties(returnList, returnList1);
        returnListDao.insertReternList();


        ReturnListGoods returnListGoods = new ReturnListGoods();
        BeanUtils.copyProperties(list, returnListGoods);
        returnListGoodsDao.insertReturnListGoods();
    }
}
